package library.and.xps.com.step.view.activity;

import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import java.util.ArrayList;

import library.and.xps.com.step.R;
import library.and.xps.com.step.adapter.OrgTypeChooseAdapter;
import library.and.xps.com.step.view.base.BaseActivity;

public class OrgTypeChooseActivity extends BaseActivity {
    ListView lv_org_type;
    OrgTypeChooseAdapter orgTypeChooseAdapter;
    ArrayList<String> teamScalevalues = new ArrayList<>();
    public static int RESPONCE_ORG_TYPE_CODE = 2;
    public static String RESPONCE_ORG_TYPE = "RESPONCE_ORG_TYPE";

    @Override
    protected int getLayout() {
        return R.layout.activity_org_type_choose;
    }

    @Override
    protected void setData() {

        teamScalevalues.add("政府/事业单位");
        teamScalevalues.add("IT行业");
        teamScalevalues.add("金融行业");
        teamScalevalues.add("专业服务");
        teamScalevalues.add("文化传媒行业");
        teamScalevalues.add("建筑/房地产");
        teamScalevalues.add("其他组织");

        orgTypeChooseAdapter = new OrgTypeChooseAdapter(this,teamScalevalues);
        lv_org_type.setAdapter(orgTypeChooseAdapter);
        lv_org_type.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Intent intent = new Intent();
                intent.putExtra(RESPONCE_ORG_TYPE, position);
                setResult(RESPONCE_ORG_TYPE_CODE, intent);
                finish();
            }
        });
    }

    @Override
    protected void init() {
        lv_org_type = r2v(R.id.lv_org_type);
    }
}
